library(AlgDesign)
library(plotly)
## Loading required package: ggplot2
## Warning: replacing previous import 'vctrs::data_frame' by 'tibble::data_frame'
## when loading 'dplyr'
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
## 3変数の場合は
dat <- gen.factorial(3, 4, varNames = c("A", "B", "C", "D"))
dat
dat <- gen.mixture(4, c("A","B","C"))
dat
cor(dat)
## A B C
## A 1.0 -0.5 -0.5
## B -0.5 1.0 -0.5
## C -0.5 -0.5 1.0
plot_ly(dat, a = ~A, b = ~B, c = ~C, marker=list(color="black", size=20), type = "scatterternary")
## No scatterternary mode specifed:
## Setting the mode to markers
## Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Ctrl+Alt+I.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Ctrl+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.